; If you meet compile error, try 'sudo apt install gcc-multilib g++-multilib' first

%include "head.include"
; you code here




your_if:
; put your implementation here

mov eax,dword[a1];       a1->eax

cmp dword[a1],12
jl label1  ;< j

cmp eax,24
jl label2

shl eax,4
mov dword[if_flag],eax

jmp student_function_end

label1:
xor edx,edx   ;edx=0
xor ecx,ecx
add ecx,2
idiv ecx  ;a1/2.被除数则为edx:eax中的内容（一个64位的整数）.商放在eax中
inc eax  ;a1/2+1
mov dword[if_flag],eax
;mov ecx,;  if_flag->ecx
jmp student_function_end

label2:
mov ebx,eax
sub ebx,24     ;ebx=a1-24 
imul ebx,eax  
imul ecx,ebx,-1     ;ecx=(24-a1)*a1
mov dword[if_flag],ecx
;mov ecx,eax
jmp student_function_end





your_while:
; put your implementation here

mov ecx,dword[a2];       a2->ecx

loop:
cmp ecx,12     ;比较a2和12
jl student_function_end

call my_random

sub ecx,12   ;a2-=12
;add [while_flag],ecx
mov dword[while_flag+ecx],eax
add ecx,11
mov dword[a2],ecx

jmp loop




%include "end.include"


your_function:
; put your implementation here

xor ecx,ecx	;	ecx=0
mov esi,[your_string]     ; 将字符串的地址加载到esi中
cmp byte[esi],0
jne loop1    ;如果不等，就跳转到loop1

jmp end

loop1:
pushad
push dword[esi]
call print_a_char
mov ecx,dword[esi]
pop ecx
popad

inc esi


cmp byte[esi],0
jne loop1    ;如果不等，就跳转到loop1

jmp end

end:
ret
